package game;

import gps.api.GPSState;

public class GridLockState implements GPSState {

	private Board board;

	public GridLockState(Board board) {
		this.board = board;
	}

	public Board getBoard() {
		return board;
	}

	public void setBoard(Board board) {
		this.board = board;
	}

	@Override
	public boolean compare(GPSState state) {
		return this.equals(state);
	}

	@Override
	public boolean isGoal() {
		return board.isGoal();
	}

	@Override
	public String toString() {
		return board.toString();
	}

	@Override
	public int hashCode() {
		return board.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GridLockState other = (GridLockState) obj;
		if (board == null) {
			if (other.board != null)
				return false;
		} else if (!board.equals(other.board))
			return false;
		return true;
	}

}
